<script setup>
import {ref} from "vue"
import A from "./components/A.vue"
import B from "./components/B.vue"
const isshow = ref(true)
</script>
<template>

  <!-- 
    component 是一个动态组件
        -component最终以什么标签实现由is属性决定
   -->
  <component :is="isshow ? A : B">我是component</component>
  <button @click="isshow = !isshow">点我切换</button>
</template>